#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n[100001],r[100001];
    cin>>n[100001]>>r[100001];
    for(int i,j;i,j<=n[100001];;i!=j;i,j++){
       if(i>=j){
         j==0; 
       }
      
    }
    cout<<i<<"";
    
    return 0;
}

